package com.nulstudio.sppm.entity;

import java.util.Objects;

public final class Supplier {
    private final int id;
    private final String name, contact, phone, email, address;

    public Supplier() {
        this.id = 0;
        this.name = null;
        this.contact = null;
        this.phone = null;
        this.email = null;
        this.address = null;
    }

    public Supplier(int id, String name, String contact, String phone, String email, String address) {
        this.id = id;
        this.name = name;
        this.contact = contact;
        this.phone = phone;
        this.email = email;
        this.address = address;
    }


    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getContact() {
        return contact;
    }

    public String getPhone() {
        return phone;
    }

    public String getEmail() {
        return email;
    }

    public String getAddress() {
        return address;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Supplier supplier = (Supplier) o;
        return id == supplier.id && Objects.equals(name, supplier.name)
                && Objects.equals(contact, supplier.contact) && Objects.equals(phone, supplier.phone)
                && Objects.equals(email, supplier.email) && Objects.equals(address, supplier.address);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, contact, phone, email, address);
    }
}
